package com.example.s09websocket;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;


//// 开启webSoecket配置
@EnableWebSocket
@SpringBootApplication
public class PackageApplication extends SpringBootServletInitializer {


    public static void main(String[] args) {
        SpringApplication.run(PackageApplication.class, args);
    }
    // 提供webSoecket功能
    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }
}
//@SpringBootApplication
//public class PackageApplication extends SpringBootServletInitializer {
//    @Override
//    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
//        return application.sources(PackageApplication.class);
//    }
//    public static void main(String[] args) {
//        SpringApplication.run(PackageApplication.class, args);
//    }
//        // 提供webSoecket功能
//    @Bean
//    public ServerEndpointExporter serverEndpointExporter() {
//        return new ServerEndpointExporter();
//    }
//}
